Description
Preview mode (glamour read view) currently inherits the app-wide tea.WithMouseCellMotion() set in main.go, so the terminal hands all mouse events to glint instead of the terminal emulator, blocking native click-drag text selection and Cmd+C. Editor mode needs mouse capture for drag-select (TASK-027); preview mode is read-only and doesn't. Fix: in togglePreview() (internal/app/app.go), emit tea.DisableMouse() when entering ModePreview and tea.EnableMouseCellMotion() when leaving it, so preview restores normal terminal text selection while editor mode is unaffected.
Acceptance Criteria
- #1 Entering preview mode (Ctrl+P / glint -p) releases mouse capture so the terminal emulator handles click-drag selection natively
- #2 Leaving preview mode back to editor re-enables mouse capture so drag-select (TASK-027) still works
- #3 Selecting text in preview with the mouse and pressing Cmd+C copies via the terminal's native clipboard mechanism, verified manually
- #4 Scroll wheel in preview still works (viewport scroll unaffected)
- #5 Test covers togglePreview emitting the right mouse cmd on entry/exit
Implementation Notes
togglePreview() now returns tea.DisableMouse on entry / tea.EnableMouseCellMotion on exit. main.go's run() also skips tea.WithMouseCellMotion() at startup when launching straight into preview (glint -p), via new App.InPreview(). Wheel-scroll still reaches the viewport via arrow-key emulation most terminals do for alt-screen apps when mouse reporting is off, and PgUp/PgDn/j/k already work via bubbles viewport's key handling regardless. AC#3 (manual Cmd+C verification) left unchecked โ needs a human to test in an actual terminal.
Correction: AC#4 unchecked too โ arrow-key wheel emulation when mouse-off is common (iTerm2/xterm/kitty in alt-screen) but not guaranteed on every terminal; needs the same manual check as AC#3, not asserted from code alone.